/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.prototype.vaadin;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Cmd
 */
public class AppProperties {
     Properties prop = new Properties();
     
     public AppProperties(String path){
        FileInputStream as;
        try {
            as = new FileInputStream(path);
            prop.load(as);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(SearchInterface.class.getName()).log(Level.SEVERE, null, ex);  
        } catch (IOException ex) {
            Logger.getLogger(SearchInterface.class.getName()).log(Level.SEVERE, null, ex);
        }
     }
     
     public String getPropValue(String propkey) throws Exception{
        if(prop.containsKey(propkey)){
            return prop.getProperty(propkey);
        }else{
             throw new Exception("Invalidate key !");
         }
     }
}
